<template>
	<view class="paywait">
		<!-- 头部 -->
		<image class="info_yy" src="../../static/yy.jpg"></image>
		<!-- 内容 -->
		<view class="paywait_info">
			<view class="paywait_box paywait_margin20 font15 font-323232 font-b">
				<view>出诊医生:</view>
				<text>{{detailsobj.doctor_info.name}}</text>
			</view>
			<!-- 			<view class="paywait_box paywait_margin10">
				<view class="font14 font-323232">排队序号:</view>
				<text class="font14 font-ef9140">A005</text>
			</view> -->
			<view class="paywait_box paywait_margin10">
				<view class="font14 font-323232">支付金额:</view>
				<text class="font14 font-ef9140">￥{{detailsobj.pay_price}}</text>
			</view>
			<view class="paywait_box paywait_margin10">
				<view class="font14 font-323232">您当前的就诊状态:</view>
				<text class="font14 font-ef9140">{{detailsobj.status == 'normal'?'等待医生接诊':detailsobj.status == 'refund'?'已退款':detailsobj.status == 'confirm'?'咨询中':detailsobj.status == 'end'?'已完成':''}}</text>
			</view>
			<view :class="detailsobj.status == 'confirm'?'optional':'nochoice'" class="paywait_margint50" @click="Onjump">点击进入视频诊室</view>
			<view class="optional paywait_margint20" @click="Onorderdetails">刷新</view>
			<view class="reminder font-ef9140">温馨提示</view>
			<view class="reminder_text font13 font-989898">1,如遇网络延迟导致就诊状态未更新,可手动点击刷新按钮！</view>
			<view class="reminder_text font13 font-989898">2,为了方便您更好的咨询,请你提前对音视频进行测试.</view>
		</view>
	</view>
</template>

<script>
	export default {
		onLoad: function(options) {
			this.id = options.id
			this.Onorderdetails()
		},
		data() {
			return {
				id: null,
				detailsobj: {}, //数据
			}
		},
		methods: {
			//详情
			Onorderdetails() {
				this.$Http({
					url: 'video_my_order_details',
					data: {
						order_id: this.id
					},
				}).then(res => {
					if (res.code = 1) {
						this.detailsobj = res.data
					}
				})
			},
			Onjump(e) {
				if (this.detailsobj.status == 'confirm') {
					uni.navigateTo({
						url: '/pagesA/common/video?id=' + this.id + '&type=user',
					})
				} else {
					uni.showToast({
						icon: 'none',
						duration: 2000,
						title: '请等待医生接诊'
					});
				}
			}
		}
	}
</script>

<style>
	.paywait {
		width: 750rpx;
		position: relative;
		height: 100%;
	}

	/* 头部图片 */
	.info_yy {
		width: 750rpx;
		height: 320rpx;
	}

	/* 内容 */
	.paywait_info {
		position: absolute;
		width: 690rpx;
		margin: 0 30rpx;
		padding: 50rpx 0;
		top: 200rpx;
		border-radius: 30rpx;
		background-color: #ffffff;
		box-shadow: 0px 0px 50rpx 0px rgba(213, 213, 213, 0.5);
	}

	.paywait_box {
		width: 690rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.paywait_margin20 {
		margin-bottom: 20rpx;
	}

	.paywait_margin10 {
		margin-bottom: 10rpx;
	}

	.paywait_margint50 {
		margin-top: 50rpx;
	}

	.paywait_margint20 {
		margin-top: 20rpx;
	}

	.paywait_box view {
		margin-right: 20rpx;
	}

	/* 按钮 */
	.optional {
		width: 420rpx;
		height: 80rpx;
		background-color: #6bcbb6;
		line-height: 80rpx;
		text-align: center;
		color: #fff;
		font-size: 28rpx;
		border-radius: 50rpx;
		margin-left: auto;
		margin-right: auto;
	}

	.nochoice {
		width: 420rpx;
		height: 80rpx;
		background-color: #989898;
		line-height: 80rpx;
		text-align: center;
		color: #fff;
		font-size: 28rpx;
		border-radius: 50rpx;
		margin-left: auto;
		margin-right: auto;
	}

	.reminder {
		width: 690rpx;
		text-align: center;
		font-size: 26rpx;
		margin-top: 50rpx;
		padding-bottom: 20rpx;
	}

	.reminder_text {
		width: 690rpx;
		padding: 0 40rpx;
		margin-top: 10rpx;
		line-height: 50rpx;
	}
</style>
